<!DOCTYPE html>
<html lang="zh-CN">
 <head> 
  <meta charset="UTF-8" /> 
  <meta name="renderer" content="webkit" /> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
  <meta name="author" content="xiaoke" /> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=0,uc-fitscreen=yes" /> 
  <meta name="screen-orientation" content="portrait" /> 
  <meta name="full-screen" content="yes" /> 
  <meta name="browsermode" content="application" /> 
  <meta name="x5-fullscreen" content="true" /> 
  <meta name="x5-orientation" content="portrait" /> 
  <meta name="x5-page-mode" content="app" /> 
  <meta name="apple-mobile-web-app-capable" content="yes" /> 
  <meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
  <meta name="format-detection" content="telphone=no, email=no" /> 
  <title>{$webTitle} - {:config('web_webname')}</title>
  <link rel="stylesheet" type="text/css" href="//cdn.istt.cn/cdn/ver/1.0/wap/app.css" /> 
  <link rel="stylesheet" type="text/css" href="//cdn.istt.cn/cdn/ver/1.0/css/style.css" /> 
  <link rel="stylesheet" type="text/css" href="//cdn.istt.cn/cdn/inc/css/animate.css" /> 
  <link rel="stylesheet" type="text/css" href="//cdn.istt.cn/cdn/inc/css/iconfont.css" /> 
  <style></style> 
 </head> 
 <body class="o-y bg-bai" ontouchstart=""> 
  <div id="ajaxshow"></div> 
  <div class="w100 bg-qing dk t-v t-l bb"> 
   <span class="w10 h8 t-v f6" onclick="history.back(-1);"><i class="icon icon-pleft f10 bold"></i></span> 
   <span class="w55 h8 t-v f8 bold">修改密码</span> 
   <span class="w10 h8 t-v f6"></span> 
  </div> 
  <div class="p3">
        <div class="mt5 h8 bb t-v"><p class="w13">* 旧 密 码</p>
            <p class="w56 mt0"><input type="password" id="outpass" class="form w100 h7 no" placeholder="请输入旧登陆密码" value="" maxlength="32"></p></div>
        <div class="mt3 h8 bb t-v"><p class="w13">* 新 密 码</p>
            <p class="w56 mt0"><input type="password" id="password" class="form w100 h7 no" placeholder="请设置新的登陆密码" value="" maxlength="32"></p></div>
        <div class="mt3 h8 bb t-v"><p class="w13">* 新 密 码</p>
            <p class="w56 mt0"><input type="password" id="repass" class="form w100 h7 no" placeholder="请再输入一次新密码" value="" maxlength="32"></p></div>
        <div class="mt8 btn btn-md btn-qing w100 h9" id="button">确 定</div>
        <div class="mt8 t-c"><a class="lan" href="{:url('index/find')}">忘记旧密码请点此使用找回密码方式进行修改</a></div>
        <div class="mt10 mb3 t-c"><p class="f2 hui">Copyright &copy; 2020 {:config('web_webname')}</p></div>
    </div> 
  <script type="text/javascript" src="/Static/config/js/jquery-2.1.4.min.js"></script>
  <script type="text/javascript" src="//cdn.istt.cn/cdn/inc/js/zepto.min.js"></script> 
  <script type="text/javascript" src="//cdn.istt.cn/cdn/ver/1.0/wap/layer.min.js"></script> 
  <script type="text/javascript" src="//cdn.istt.cn/cdn/ver/1.0/wap/app.min.js"></script> 
  <script src="/Static/config/js/gt.js"></script>
  <script src="/Static/config/js/main.js"></script>
<script>
	var handler = function (captchaObj) {
            captchaObj.onReady(function () {
            }).onSuccess(function () {
                var outpass, password, repass;
                outpass = $('#outpass').val();
				password = $('#password').val();
				repass = $('#repass').val();
				var result = captchaObj.getValidate();
				var result_data = {
					geetest_challenge: result.geetest_challenge,
					geetest_validate: result.geetest_validate,
					geetest_seccode: result.geetest_seccode,
					outpass: outpass,
					password: password,
					repass: repass,
				};
				var load = x.loading('', true);
				app.ajax("{:url('UserAjax/newpwd')}", result_data, function (data) {
					layer.close(load);
					if (data.code === 0) {
						if (result) {
							x.loading('修改密码成功,请重新登陆');
							setTimeout(function () {
								window.location.href = "{:url('Index/login')}";
							}, 1000)
						} else {
							x.btn('请先完成验证');
						}
					} else {
						x.btn(data.message);
						captchaObj.reset();
					}
				}, '', false);
            });
            $('#button').click(function () {
                var outpass, password, repass;
                outpass = $('#outpass').val();
				password = $('#password').val();
				repass = $('#repass').val();
                if (!outpass) {
                    $('#outpass').focus();
                    x.msg("请输入旧登陆密码");
                    return false;
                }
                if (!password) {
                    $('#password').focus();
                    x.msg("请输入新的登陆密码");
                    return false;
                }
                if (!repass) {
                    $('#repass').focus();
                    x.msg("请再输入一次新密码");
                    return false;
                }
				if(password != repass){
					$('#repass').focus();
					$('#password').focus();
					x.msg("两次密码输入不一致");
					return false;
				}
                captchaObj.verify();
            }
            );
        };
        app.ajax("{:url('Common/Geetest_captcha')}?t=" + (new Date()).getTime(), undefined, function (data) {
            initGeetest({
                gt: data.gt,
                challenge: data.challenge,
                offline: !data.success, // 表示用户后台检测极验服务器是否宕机
                new_captcha: data.new_captcha, // 用于宕机时表示是新验证码的宕机
                product: "bind", // 产品形式，包括：float，popup
                width: "190px",
                https: false
            }, handler);
        });
</script>
 </body>
</html>